package cn.mw.cmdb;

import cn.hutool.core.convert.ConverterRegistry;
import cn.mw.cmdb.convert.hutool.HutoolPropertyTypeConverter;
import cn.mw.cmdb.entity.PropertyTypeRef;
import cn.mw.log.annotaion.EnableMwOperationLog;
import cn.mw.microMonitorCommon.api.common.I18nConfig;
import cn.mw.microMonitorCommon.autoConfiguration.EnableMwFlowable;
import cn.mw.microMonitorCommon.autoConfiguration.EnableMwRedis;
import cn.mw.microMonitorCommon.security.annotation.EnableMwResourceSecurity;
import cn.mw.microMonitorCommon.util.EnableModelId;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;
import org.springframework.scheduling.annotation.EnableAsync;

@SpringBootApplication
@EnableModelId
@EnableDubbo
@EnableDiscoveryClient
@ComponentScan(basePackages = {"cn.mw.cmdb", "cn.mw.microMonitorCommon.annotation", "cn.mw.scanengine"})
@Import({I18nConfig.class})
@EnableMwRedis
@EnableMwResourceSecurity
@EnableMwOperationLog
@EnableAsync
@EnableMwFlowable
public class MwCMDBApp {
    public static void main(String[] args){
        ConverterRegistry converterRegistry = ConverterRegistry.getInstance();
        converterRegistry.putCustom(PropertyTypeRef.class ,new HutoolPropertyTypeConverter());
        SpringApplication.run(MwCMDBApp.class, args);
    }
}
